$OpenBSD: patch-igd_desc_parse_c,v 1.1 2015/11/03 13:58:51 dcoppa Exp $

commit 79cca974a4c2ab1199786732a67ff6d898051b78
Author: Thomas Bernard <miniupnp@free.fr>
Date:   Tue Sep 15 15:32:33 2015 +0200

igd_desc_parse.c: fix buffer overflow

http://talosintel.com/reports/TALOS-2015-0035/

--- igd_desc_parse.c.orig	Mon Apr 11 11:19:37 2011
+++ igd_desc_parse.c	Tue Nov  3 12:08:09 2015
@@ -15,7 +15,9 @@
 void IGDstartelt(void * d, const char * name, int l)
 {
 	struct IGDdatas * datas = (struct IGDdatas *)d;
-	memcpy( datas->cureltname, name, l);
+	if(l >= MINIUPNPC_URL_MAXSIZE)
+		l = MINIUPNPC_URL_MAXSIZE-1;
+	memcpy(datas->cureltname, name, l);
 	datas->cureltname[l] = '\0';
 	datas->level++;
 	if( (l==7) && !memcmp(name, "service", l) ) {
